package com.mujin.keji.collectionsystem.utils;

import android.content.Context;
import android.graphics.Rect;
import android.support.v7.app.AppCompatActivity;

/**
 * 软键盘工具类
 *
 * @author weishixiong
 * @Time 2018-03-19
 */
public class KeyBordUtils {
    /**
     * 判断键盘是否是弹起 还是关闭
     *
     * @param context
     * @return
     */
    private boolean isSoftShowing(AppCompatActivity context) {
        //获取当前屏幕内容的高度
        int screenHeight = context.getWindow().getDecorView().getHeight();
        //获取View可见区域的bottom
        Rect rect = new Rect();
        context.getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);

        return screenHeight - rect.bottom != 0;
    }
}
